package cn.edu.zut.score.core.constant;

import io.swagger.annotations.ApiModel;

/**
 * @author zby
 * @date 2021/06/28
 */
@ApiModel("小组类型枚举")
public enum GroupTypeEnum {
    //

    temp(0, "临时"),
    plea(1, "答辩"),
    check(2, "检查"),
    open(3, "开题"),
    person(4, "个人");

    private Integer code;
    private String type;

    GroupTypeEnum(Integer code, String type) {
        this.code = code;
        this.type = type;
    }

    public static String getTypeByCode(Integer code) {
        GroupTypeEnum[] enums = values();
        for (GroupTypeEnum anEnum : enums) {
            if (anEnum.code.equals(code)) {
                return anEnum.getType();
            }
        }
        return "";
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}

